import akshare as ak

# stock_zh_a_minute_df = ak.stock_zh_a_minute(symbol='sh600545', 
#                                             period='5', 
#                                             adjust="")
# print(stock_zh_a_minute_df)



# 注意：该接口返回的数据只有最近一个交易日的有开盘价，其他日期开盘价为 0
stock_zh_a_hist_min_em_df = ak.stock_zh_a_hist_min_em(symbol="300750", 
                                                      start_date="2025-09-01 08:30:00",
                                                      end_date="2025-09-01 15:00:00", 
                                                      period="5", 
                                                      adjust="")
# print(stock_zh_a_hist_min_em_df)
# print(type(stock_zh_a_hist_min_em_df))

# for item in stock_zh_a_hist_min_em_df:
#     print('='*30)
#     print(item)


# 方法1: 使用iterrows() - 返回索引和每行数据(Series)
# for index, row in stock_zh_a_hist_min_em_df.iterrows():
#     print(f"Index: {index}")
#     print(f"Row data: {row}\n")

# 方法2: 使用itertuples() - 返回命名元组，速度比iterrows()快
for row in stock_zh_a_hist_min_em_df.itertuples():
    print(row)